{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import arcpy,folium,json"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "# GeoQ地图灰色版\n",
    "tile=\"http://map.geoq.cn/ArcGIS/rest/services/ChinaOnlineStreetGray/MapServer/tile/{z}/{y}/{x}\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {},
   "outputs": [],
   "source": [
    "sr = arcpy.SpatialReference(4326)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {},
   "outputs": [],
   "source": [
    "sd = arcpy.Point(116.5930544,40.0795454)\n",
    "dx = arcpy.Point(116.4168081, 39.5129736)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {},
   "outputs": [],
   "source": [
    "line = arcpy.Polyline(inputs=arcpy.Array([sd,dx]),\n",
    "spatial_reference=sr)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'{\"paths\":[[[116.5930544,40.079545400000001],[116.4168081,39.512973600000002]]],\"spatialReference\":{\"wkid\":4326,\"latestWkid\":4326}}'"
      ]
     },
     "execution_count": 31,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "line.JSON"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "* 可视化用foilum绘制出来看效果，下面这个函数是把arcpy的对象转foilum对象的方法，具体解析以后再说"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "metadata": {},
   "outputs": [],
   "source": [
    "def aLineTofLine(arcpyLine:arcpy.Polyline,color=\"red\"):\n",
    "    coord = []\n",
    "    for r in json.loads(arcpyLine.JSON)[\"paths\"]:\n",
    "        c = []\n",
    "        for r2 in r:\n",
    "            c.append([r2[1],r2[0]])\n",
    "        coord.append(c)\n",
    "    return folium.PolyLine(locations=coord,color=color)\n",
    "    "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div style=\"width:100%;\"><div style=\"position:relative;width:100%;height:0;padding-bottom:60%;\"><span style=\"color:#565656\">Make this Notebook Trusted to load map: File -> Trust Notebook</span><iframe srcdoc=\"&lt;!DOCTYPE html&gt;\n",
       "&lt;head&gt;    \n",
       "    &lt;meta http-equiv=&quot;content-type&quot; content=&quot;text/html; charset=UTF-8&quot; /&gt;\n",
       "    \n",
       "        &lt;script&gt;\n",
       "            L_NO_TOUCH = false;\n",
       "            L_DISABLE_3D = false;\n",
       "        &lt;/script&gt;\n",
       "    \n",
       "    &lt;style&gt;html, body {width: 100%;height: 100%;margin: 0;padding: 0;}&lt;/style&gt;\n",
       "    &lt;style&gt;#map {position:absolute;top:0;bottom:0;right:0;left:0;}&lt;/style&gt;\n",
       "    &lt;script src=&quot;https://cdn.jsdelivr.net/npm/leaflet@1.6.0/dist/leaflet.js&quot;&gt;&lt;/script&gt;\n",
       "    &lt;script src=&quot;https://code.jquery.com/jquery-1.12.4.min.js&quot;&gt;&lt;/script&gt;\n",
       "    &lt;script src=&quot;https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js&quot;&gt;&lt;/script&gt;\n",
       "    &lt;script src=&quot;https://cdnjs.cloudflare.com/ajax/libs/Leaflet.awesome-markers/2.0.2/leaflet.awesome-markers.js&quot;&gt;&lt;/script&gt;\n",
       "    &lt;link rel=&quot;stylesheet&quot; href=&quot;https://cdn.jsdelivr.net/npm/leaflet@1.6.0/dist/leaflet.css&quot;/&gt;\n",
       "    &lt;link rel=&quot;stylesheet&quot; href=&quot;https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css&quot;/&gt;\n",
       "    &lt;link rel=&quot;stylesheet&quot; href=&quot;https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap-theme.min.css&quot;/&gt;\n",
       "    &lt;link rel=&quot;stylesheet&quot; href=&quot;https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css&quot;/&gt;\n",
       "    &lt;link rel=&quot;stylesheet&quot; href=&quot;https://cdnjs.cloudflare.com/ajax/libs/Leaflet.awesome-markers/2.0.2/leaflet.awesome-markers.css&quot;/&gt;\n",
       "    &lt;link rel=&quot;stylesheet&quot; href=&quot;https://cdn.jsdelivr.net/gh/python-visualization/folium/folium/templates/leaflet.awesome.rotate.min.css&quot;/&gt;\n",
       "    \n",
       "            &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width,\n",
       "                initial-scale=1.0, maximum-scale=1.0, user-scalable=no&quot; /&gt;\n",
       "            &lt;style&gt;\n",
       "                #map_df5eac82795d23c66ac978d77c632df1 {\n",
       "                    position: relative;\n",
       "                    width: 100.0%;\n",
       "                    height: 100.0%;\n",
       "                    left: 0.0%;\n",
       "                    top: 0.0%;\n",
       "                }\n",
       "            &lt;/style&gt;\n",
       "        \n",
       "&lt;/head&gt;\n",
       "&lt;body&gt;    \n",
       "    \n",
       "            &lt;div class=&quot;folium-map&quot; id=&quot;map_df5eac82795d23c66ac978d77c632df1&quot; &gt;&lt;/div&gt;\n",
       "        \n",
       "&lt;/body&gt;\n",
       "&lt;script&gt;    \n",
       "    \n",
       "            var map_df5eac82795d23c66ac978d77c632df1 = L.map(\n",
       "                &quot;map_df5eac82795d23c66ac978d77c632df1&quot;,\n",
       "                {\n",
       "                    center: [39.9, 116.39],\n",
       "                    crs: L.CRS.EPSG3857,\n",
       "                    zoom: 9,\n",
       "                    zoomControl: true,\n",
       "                    preferCanvas: false,\n",
       "                }\n",
       "            );\n",
       "\n",
       "            \n",
       "\n",
       "        \n",
       "    \n",
       "            var tile_layer_e543678946abe57ddaac8cf0eb7d4ae4 = L.tileLayer(\n",
       "                &quot;http://map.geoq.cn/ArcGIS/rest/services/ChinaOnlineStreetGray/MapServer/tile/{z}/{y}/{x}&quot;,\n",
       "                {&quot;attribution&quot;: &quot;geoq&quot;, &quot;detectRetina&quot;: false, &quot;maxNativeZoom&quot;: 18, &quot;maxZoom&quot;: 18, &quot;minZoom&quot;: 0, &quot;noWrap&quot;: false, &quot;opacity&quot;: 1, &quot;subdomains&quot;: &quot;abc&quot;, &quot;tms&quot;: false}\n",
       "            ).addTo(map_df5eac82795d23c66ac978d77c632df1);\n",
       "        \n",
       "    \n",
       "            var poly_line_0f07d37faf7157b6b54079e8f90005bb = L.polyline(\n",
       "                [[[40.0795454, 116.5930544], [39.5129736, 116.4168081]]],\n",
       "                {&quot;bubblingMouseEvents&quot;: true, &quot;color&quot;: &quot;red&quot;, &quot;dashArray&quot;: null, &quot;dashOffset&quot;: null, &quot;fill&quot;: false, &quot;fillColor&quot;: &quot;red&quot;, &quot;fillOpacity&quot;: 0.2, &quot;fillRule&quot;: &quot;evenodd&quot;, &quot;lineCap&quot;: &quot;round&quot;, &quot;lineJoin&quot;: &quot;round&quot;, &quot;noClip&quot;: false, &quot;opacity&quot;: 1.0, &quot;smoothFactor&quot;: 1.0, &quot;stroke&quot;: true, &quot;weight&quot;: 3}\n",
       "            ).addTo(map_df5eac82795d23c66ac978d77c632df1);\n",
       "        \n",
       "&lt;/script&gt;\" style=\"position:absolute;width:100%;height:100%;left:0;top:0;border:none !important;\" allowfullscreen webkitallowfullscreen mozallowfullscreen></iframe></div></div>"
      ],
      "text/plain": [
       "<folium.folium.Map at 0x1dc1412a250>"
      ]
     },
     "execution_count": 36,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "m = folium.Map([39.9, 116.39],\n",
    "               tiles=tile,attr='geoq',\n",
    "               zoom_start=9)\n",
    "aLineTofLine(line).add_to(m)\n",
    "m"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 48,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "|type\t|类型\t|polyline\t\t|\n",
      "|length\t|长度\t|0.5933518035861431\t|\n",
      "|partCount|部件数量\t|1\t\t|\n",
      "|pointCount|点数量\t|2\t\t|\n",
      "|hasCurves|是否是曲线\t|False\t\t|\n",
      "|isMultipart|是否是多部件\t|False\t\t|\n"
     ]
    }
   ],
   "source": [
    "print(f\"|type\\t|类型\\t|{line.type}\\t\\t|\")\n",
    "print(f\"|length\\t|长度\\t|{line.length}\\t|\")\n",
    "print(f\"|partCount|部件数量\\t|{line.partCount}\\t\\t|\")\n",
    "print(f\"|pointCount|点数量\\t|{line.pointCount}\\t\\t|\")\n",
    "print(f\"|hasCurves|是否是曲线\\t|{line.hasCurves}\\t\\t|\")\n",
    "print(f\"|isMultipart|是否是多部件\\t|{line.isMultipart}\\t\\t|\")\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 50,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "|centroid\t|中心点\t|116.50493125 39.7962595 NaN NaN\t\t|\n",
      "|extent\t|范围\t|116.4168081 39.5129736 116.5930544 40.0795454 NaN NaN NaN NaN\t|\n",
      "|firstPoint|起始点\t|116.5930544 40.0795454 NaN NaN\t\t|\n",
      "|lastPoint|终止点\t|116.4168081 39.5129736 NaN NaN\t\t|\n",
      "|labelPoint|标注点\t|116.50493125 39.7962595 NaN NaN\t\t|\n",
      "|trueCentroid|重心\t|116.50493125 39.7962595 NaN NaN\t\t|\n"
     ]
    }
   ],
   "source": [
    "print(f\"|centroid\\t|中心点\\t|{line.centroid}\\t\\t|\")\n",
    "print(f\"|extent\\t|范围\\t|{line.extent}\\t|\")\n",
    "print(f\"|firstPoint|起始点\\t|{line.firstPoint}\\t\\t|\")\n",
    "print(f\"|lastPoint|终止点\\t|{line.lastPoint}\\t\\t|\")\n",
    "print(f\"|labelPoint|标注点\\t|{line.labelPoint}\\t\\t|\")\n",
    "print(f\"|trueCentroid|重心\\t|{line.trueCentroid}\\t\\t|\")\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 57,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div style=\"width:100%;\"><div style=\"position:relative;width:100%;height:0;padding-bottom:60%;\"><span style=\"color:#565656\">Make this Notebook Trusted to load map: File -> Trust Notebook</span><iframe srcdoc=\"&lt;!DOCTYPE html&gt;\n",
       "&lt;head&gt;    \n",
       "    &lt;meta http-equiv=&quot;content-type&quot; content=&quot;text/html; charset=UTF-8&quot; /&gt;\n",
       "    \n",
       "        &lt;script&gt;\n",
       "            L_NO_TOUCH = false;\n",
       "            L_DISABLE_3D = false;\n",
       "        &lt;/script&gt;\n",
       "    \n",
       "    &lt;style&gt;html, body {width: 100%;height: 100%;margin: 0;padding: 0;}&lt;/style&gt;\n",
       "    &lt;style&gt;#map {position:absolute;top:0;bottom:0;right:0;left:0;}&lt;/style&gt;\n",
       "    &lt;script src=&quot;https://cdn.jsdelivr.net/npm/leaflet@1.6.0/dist/leaflet.js&quot;&gt;&lt;/script&gt;\n",
       "    &lt;script src=&quot;https://code.jquery.com/jquery-1.12.4.min.js&quot;&gt;&lt;/script&gt;\n",
       "    &lt;script src=&quot;https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js&quot;&gt;&lt;/script&gt;\n",
       "    &lt;script src=&quot;https://cdnjs.cloudflare.com/ajax/libs/Leaflet.awesome-markers/2.0.2/leaflet.awesome-markers.js&quot;&gt;&lt;/script&gt;\n",
       "    &lt;link rel=&quot;stylesheet&quot; href=&quot;https://cdn.jsdelivr.net/npm/leaflet@1.6.0/dist/leaflet.css&quot;/&gt;\n",
       "    &lt;link rel=&quot;stylesheet&quot; href=&quot;https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css&quot;/&gt;\n",
       "    &lt;link rel=&quot;stylesheet&quot; href=&quot;https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap-theme.min.css&quot;/&gt;\n",
       "    &lt;link rel=&quot;stylesheet&quot; href=&quot;https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css&quot;/&gt;\n",
       "    &lt;link rel=&quot;stylesheet&quot; href=&quot;https://cdnjs.cloudflare.com/ajax/libs/Leaflet.awesome-markers/2.0.2/leaflet.awesome-markers.css&quot;/&gt;\n",
       "    &lt;link rel=&quot;stylesheet&quot; href=&quot;https://cdn.jsdelivr.net/gh/python-visualization/folium/folium/templates/leaflet.awesome.rotate.min.css&quot;/&gt;\n",
       "    \n",
       "            &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width,\n",
       "                initial-scale=1.0, maximum-scale=1.0, user-scalable=no&quot; /&gt;\n",
       "            &lt;style&gt;\n",
       "                #map_401b5307a3be48cfee70bf9979191e70 {\n",
       "                    position: relative;\n",
       "                    width: 100.0%;\n",
       "                    height: 100.0%;\n",
       "                    left: 0.0%;\n",
       "                    top: 0.0%;\n",
       "                }\n",
       "            &lt;/style&gt;\n",
       "        \n",
       "&lt;/head&gt;\n",
       "&lt;body&gt;    \n",
       "    \n",
       "            &lt;div class=&quot;folium-map&quot; id=&quot;map_401b5307a3be48cfee70bf9979191e70&quot; &gt;&lt;/div&gt;\n",
       "        \n",
       "&lt;/body&gt;\n",
       "&lt;script&gt;    \n",
       "    \n",
       "            var map_401b5307a3be48cfee70bf9979191e70 = L.map(\n",
       "                &quot;map_401b5307a3be48cfee70bf9979191e70&quot;,\n",
       "                {\n",
       "                    center: [39.9, 116.39],\n",
       "                    crs: L.CRS.EPSG3857,\n",
       "                    zoom: 9,\n",
       "                    zoomControl: true,\n",
       "                    preferCanvas: false,\n",
       "                }\n",
       "            );\n",
       "\n",
       "            \n",
       "\n",
       "        \n",
       "    \n",
       "            var tile_layer_78cefb93ab4c849e5bf47aad324ec23e = L.tileLayer(\n",
       "                &quot;http://map.geoq.cn/ArcGIS/rest/services/ChinaOnlineStreetGray/MapServer/tile/{z}/{y}/{x}&quot;,\n",
       "                {&quot;attribution&quot;: &quot;geoq&quot;, &quot;detectRetina&quot;: false, &quot;maxNativeZoom&quot;: 18, &quot;maxZoom&quot;: 18, &quot;minZoom&quot;: 0, &quot;noWrap&quot;: false, &quot;opacity&quot;: 1, &quot;subdomains&quot;: &quot;abc&quot;, &quot;tms&quot;: false}\n",
       "            ).addTo(map_401b5307a3be48cfee70bf9979191e70);\n",
       "        \n",
       "    \n",
       "            var marker_440dbc56abfe06564aab888dfd4d6b7d = L.marker(\n",
       "                [39.796259500000005, 116.50493125],\n",
       "                {}\n",
       "            ).addTo(map_401b5307a3be48cfee70bf9979191e70);\n",
       "        \n",
       "    \n",
       "            var icon_ab19ecb516437c2808fb5f15829516c8 = L.AwesomeMarkers.icon(\n",
       "                {&quot;extraClasses&quot;: &quot;fa-rotate-0&quot;, &quot;icon&quot;: &quot;info-sign&quot;, &quot;iconColor&quot;: &quot;white&quot;, &quot;markerColor&quot;: &quot;red&quot;, &quot;prefix&quot;: &quot;glyphicon&quot;}\n",
       "            );\n",
       "            marker_440dbc56abfe06564aab888dfd4d6b7d.setIcon(icon_ab19ecb516437c2808fb5f15829516c8);\n",
       "        \n",
       "    \n",
       "            var marker_d316fd9ef513b4d6e8f151e5dc869e02 = L.marker(\n",
       "                [40.0795454, 116.5930544],\n",
       "                {}\n",
       "            ).addTo(map_401b5307a3be48cfee70bf9979191e70);\n",
       "        \n",
       "    \n",
       "            var icon_fea7b7394bfba749f6deb32c05fddd7f = L.AwesomeMarkers.icon(\n",
       "                {&quot;extraClasses&quot;: &quot;fa-rotate-0&quot;, &quot;icon&quot;: &quot;info-sign&quot;, &quot;iconColor&quot;: &quot;white&quot;, &quot;markerColor&quot;: &quot;orange&quot;, &quot;prefix&quot;: &quot;glyphicon&quot;}\n",
       "            );\n",
       "            marker_d316fd9ef513b4d6e8f151e5dc869e02.setIcon(icon_fea7b7394bfba749f6deb32c05fddd7f);\n",
       "        \n",
       "    \n",
       "            var marker_c80102e7ed00c7e47f61301dd260896b = L.marker(\n",
       "                [39.5129736, 116.4168081],\n",
       "                {}\n",
       "            ).addTo(map_401b5307a3be48cfee70bf9979191e70);\n",
       "        \n",
       "    \n",
       "            var icon_7e286a34d7d4992239a54d7cc27323ad = L.AwesomeMarkers.icon(\n",
       "                {&quot;extraClasses&quot;: &quot;fa-rotate-0&quot;, &quot;icon&quot;: &quot;info-sign&quot;, &quot;iconColor&quot;: &quot;white&quot;, &quot;markerColor&quot;: &quot;green&quot;, &quot;prefix&quot;: &quot;glyphicon&quot;}\n",
       "            );\n",
       "            marker_c80102e7ed00c7e47f61301dd260896b.setIcon(icon_7e286a34d7d4992239a54d7cc27323ad);\n",
       "        \n",
       "    \n",
       "            var poly_line_20bfd06aefbded06d49141afa3f5f070 = L.polyline(\n",
       "                [[[40.0795454, 116.5930544], [39.5129736, 116.4168081]]],\n",
       "                {&quot;bubblingMouseEvents&quot;: true, &quot;color&quot;: &quot;red&quot;, &quot;dashArray&quot;: null, &quot;dashOffset&quot;: null, &quot;fill&quot;: false, &quot;fillColor&quot;: &quot;red&quot;, &quot;fillOpacity&quot;: 0.2, &quot;fillRule&quot;: &quot;evenodd&quot;, &quot;lineCap&quot;: &quot;round&quot;, &quot;lineJoin&quot;: &quot;round&quot;, &quot;noClip&quot;: false, &quot;opacity&quot;: 1.0, &quot;smoothFactor&quot;: 1.0, &quot;stroke&quot;: true, &quot;weight&quot;: 3}\n",
       "            ).addTo(map_401b5307a3be48cfee70bf9979191e70);\n",
       "        \n",
       "&lt;/script&gt;\" style=\"position:absolute;width:100%;height:100%;left:0;top:0;border:none !important;\" allowfullscreen webkitallowfullscreen mozallowfullscreen></iframe></div></div>"
      ],
      "text/plain": [
       "<folium.folium.Map at 0x1dc1416de50>"
      ]
     },
     "execution_count": 57,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "m = folium.Map([39.9, 116.39],\n",
    "               tiles=tile,attr='geoq',\n",
    "               zoom_start=9)\n",
    "folium.Marker(location=[line.centroid.Y,line.centroid.X],\n",
    "icon=folium.Icon(color='red')).add_to(m)\n",
    "folium.Marker(location=[line.firstPoint.Y,line.firstPoint.X],\n",
    "icon=folium.Icon(color='orange')).add_to(m)\n",
    "folium.Marker(location=[line.lastPoint.Y,line.lastPoint.X],\n",
    "icon=folium.Icon(color='green')).add_to(m)\n",
    "aLineTofLine(line).add_to(m)\n",
    "m"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "* 从bj_road里面取出二环路来，这个查询接口我们以后会专门讲，这里略过"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [],
   "source": [
    "\n",
    "with arcpy.da.SearchCursor(\"../data/beijing/bj_road.shp\",\n",
    "[\"Shape@\"],\"NAME='二环路'\") as cur:\n",
    "    for row in cur:\n",
    "        road = row[0]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 59,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "|type\t|类型\t|polyline\t\t|\n",
      "|length\t|长度\t|0.6814194931260913\t|\n",
      "|partCount|部件数量\t|5\t\t|\n",
      "|pointCount|点数量\t|516\t\t|\n",
      "|hasCurves|是否是曲线\t|False\t\t|\n",
      "|isMultipart|是否是多部件\t|True\t\t|\n"
     ]
    }
   ],
   "source": [
    "print(f\"|type\\t|类型\\t|{road.type}\\t\\t|\")\n",
    "print(f\"|length\\t|长度\\t|{road.length}\\t|\")\n",
    "print(f\"|partCount|部件数量\\t|{road.partCount}\\t\\t|\")\n",
    "print(f\"|pointCount|点数量\\t|{road.pointCount}\\t\\t|\")\n",
    "print(f\"|hasCurves|是否是曲线\\t|{road.hasCurves}\\t\\t|\")\n",
    "print(f\"|isMultipart|是否是多部件\\t|{road.isMultipart}\\t\\t|\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 67,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div style=\"width:100%;\"><div style=\"position:relative;width:100%;height:0;padding-bottom:60%;\"><span style=\"color:#565656\">Make this Notebook Trusted to load map: File -> Trust Notebook</span><iframe srcdoc=\"&lt;!DOCTYPE html&gt;\n",
       "&lt;head&gt;    \n",
       "    &lt;meta http-equiv=&quot;content-type&quot; content=&quot;text/html; charset=UTF-8&quot; /&gt;\n",
       "    \n",
       "        &lt;script&gt;\n",
       "            L_NO_TOUCH = false;\n",
       "            L_DISABLE_3D = false;\n",
       "        &lt;/script&gt;\n",
       "    \n",
       "    &lt;style&gt;html, body {width: 100%;height: 100%;margin: 0;padding: 0;}&lt;/style&gt;\n",
       "    &lt;style&gt;#map {position:absolute;top:0;bottom:0;right:0;left:0;}&lt;/style&gt;\n",
       "    &lt;script src=&quot;https://cdn.jsdelivr.net/npm/leaflet@1.6.0/dist/leaflet.js&quot;&gt;&lt;/script&gt;\n",
       "    &lt;script src=&quot;https://code.jquery.com/jquery-1.12.4.min.js&quot;&gt;&lt;/script&gt;\n",
       "    &lt;script src=&quot;https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js&quot;&gt;&lt;/script&gt;\n",
       "    &lt;script src=&quot;https://cdnjs.cloudflare.com/ajax/libs/Leaflet.awesome-markers/2.0.2/leaflet.awesome-markers.js&quot;&gt;&lt;/script&gt;\n",
       "    &lt;link rel=&quot;stylesheet&quot; href=&quot;https://cdn.jsdelivr.net/npm/leaflet@1.6.0/dist/leaflet.css&quot;/&gt;\n",
       "    &lt;link rel=&quot;stylesheet&quot; href=&quot;https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css&quot;/&gt;\n",
       "    &lt;link rel=&quot;stylesheet&quot; href=&quot;https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap-theme.min.css&quot;/&gt;\n",
       "    &lt;link rel=&quot;stylesheet&quot; href=&quot;https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css&quot;/&gt;\n",
       "    &lt;link rel=&quot;stylesheet&quot; href=&quot;https://cdnjs.cloudflare.com/ajax/libs/Leaflet.awesome-markers/2.0.2/leaflet.awesome-markers.css&quot;/&gt;\n",
       "    &lt;link rel=&quot;stylesheet&quot; href=&quot;https://cdn.jsdelivr.net/gh/python-visualization/folium/folium/templates/leaflet.awesome.rotate.min.css&quot;/&gt;\n",
       "    \n",
       "            &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width,\n",
       "                initial-scale=1.0, maximum-scale=1.0, user-scalable=no&quot; /&gt;\n",
       "            &lt;style&gt;\n",
       "                #map_4556fb80700f6396b38423d4ff6ea980 {\n",
       "                    position: relative;\n",
       "                    width: 100.0%;\n",
       "                    height: 100.0%;\n",
       "                    left: 0.0%;\n",
       "                    top: 0.0%;\n",
       "                }\n",
       "            &lt;/style&gt;\n",
       "        \n",
       "&lt;/head&gt;\n",
       "&lt;body&gt;    \n",
       "    \n",
       "            &lt;div class=&quot;folium-map&quot; id=&quot;map_4556fb80700f6396b38423d4ff6ea980&quot; &gt;&lt;/div&gt;\n",
       "        \n",
       "&lt;/body&gt;\n",
       "&lt;script&gt;    \n",
       "    \n",
       "            var map_4556fb80700f6396b38423d4ff6ea980 = L.map(\n",
       "                &quot;map_4556fb80700f6396b38423d4ff6ea980&quot;,\n",
       "                {\n",
       "                    center: [39.9, 116.39],\n",
       "                    crs: L.CRS.EPSG3857,\n",
       "                    zoom: 12,\n",
       "                    zoomControl: true,\n",
       "                    preferCanvas: false,\n",
       "                }\n",
       "            );\n",
       "\n",
       "            \n",
       "\n",
       "        \n",
       "    \n",
       "            var tile_layer_6f2541f7c31baa7abb10ebedc98553e8 = L.tileLayer(\n",
       "                &quot;http://map.geoq.cn/ArcGIS/rest/services/ChinaOnlineStreetGray/MapServer/tile/{z}/{y}/{x}&quot;,\n",
       "                {&quot;attribution&quot;: &quot;geoq&quot;, &quot;detectRetina&quot;: false, &quot;maxNativeZoom&quot;: 18, &quot;maxZoom&quot;: 18, &quot;minZoom&quot;: 0, &quot;noWrap&quot;: false, &quot;opacity&quot;: 1, &quot;subdomains&quot;: &quot;abc&quot;, &quot;tms&quot;: false}\n",
       "            ).addTo(map_4556fb80700f6396b38423d4ff6ea980);\n",
       "        \n",
       "    \n",
       "            var poly_line_329407d2abd3197b0251b93f602c1fcb = L.polyline(\n",
       "                [[[39.86661000025134, 116.34061999961341], [39.86661000025134, 116.34165000034727], [39.86661000025134, 116.34309999976529]], [[39.86673999995111, 116.34315000027232], [39.86673999995111, 116.34169999995504], [39.86673999995111, 116.34057999956735], [39.86673999995111, 116.3392500002874]], [[39.86706999988064, 116.34806999963087], [39.86719999958035, 116.34580999973173], [39.86729000013344, 116.3449099995969], [39.86737000022538, 116.34451999959833], [39.86751000038629, 116.34418000010703], [39.86784999987765, 116.34362000036276], [39.868070000130444, 116.34340999967185], [39.86840999962186, 116.34315000027232], [39.86930999975675, 116.34280000031981], [39.871459999979095, 116.34309999976529], [39.87299999995008, 116.34327999997208], [39.87398999973874, 116.34327999997208], [39.87505999961934, 116.34323000036431], [39.87995999985418, 116.34284999992758], [39.88176000012396, 116.34276000027387], [39.885149999972555, 116.34276000027387], [39.885660000109, 116.34276000027387], [39.88592000040774, 116.34276000027387], [39.8866899999436, 116.34276000027387], [39.88935000030233, 116.34272000022793], [39.8898299999546, 116.34266999972078], [39.890509999836695, 116.34262999967484], [39.891200000179936, 116.34262999967484], [39.89206000026883, 116.34262999967484], [39.89282999980469, 116.34258999962879], [39.89389999968529, 116.34254000002102], [39.89514999977274, 116.34254000002102], [39.89541000007148, 116.34262999967484], [39.895829999654836, 116.34293000001958], [39.89621999965334, 116.34336000006397], [39.89647000039025, 116.34375000006253], [39.89664000013596, 116.34438999989868], [39.89672999978973, 116.34494999964284], [39.89676999983567, 116.34549999982517], [39.89693999958138, 116.3483699999756], [39.897030000134464, 116.34888999967382], [39.89715999983417, 116.34927000011044], [39.89748999976371, 116.3498400003158], [39.89791999980821, 116.3502599998991], [39.89818000010695, 116.3504299996448], [39.89865000019739, 116.35060000028989], [39.89955000033228, 116.35062999987463], [39.90161000000154, 116.35060000028989], [39.90238000043672, 116.35054999978274], [39.90284999962785, 116.35054999978274], [39.903800000269825, 116.3505099997368], [39.90462000031283, 116.35046999969074], [39.906840000165914, 116.35038000003703], [39.907529999609835, 116.35033999999109], [39.909160000133966, 116.35046999969074], [39.910669999620836, 116.35060000028989], [39.915259999949114, 116.35038000003703], [39.917060000218896, 116.35029000038332], [39.91872999988965, 116.35029000038332], [39.91975999972425, 116.35025000033727], [39.92014999972275, 116.35025000033727], [39.921259999649294, 116.35021000029133], [39.92328000017193, 116.35011999973824], [39.92500000034977, 116.35003999964636], [39.92619999993008, 116.34999000003859], [39.926890000273374, 116.34994999999253], [39.92769999985518, 116.34990999994659], [39.92855999994407, 116.3498299998547], [39.934100000015064, 116.34960000004003], [39.935339999641315, 116.34960000004003], [39.936239999776205, 116.34956999955591], [39.93658999972877, 116.34956999955591], [39.9403199999681, 116.34931000015649], [39.94091999975825, 116.34947999990209], [39.94138999984864, 116.3496499996478], [39.94212000023788, 116.35015999978418], [39.94237999963735, 116.35046999969074], [39.94245999972924, 116.35062999987463], [39.9428099996818, 116.35157999961734], [39.94284999972774, 116.35192000000802], [39.943110000026536, 116.35280999968177], [39.94358000011698, 116.35444999976778], [39.94387000000057, 116.35555999969426], [39.944469999790726, 116.35766999987061], [39.944939999881115, 116.35924000032583], [39.94512000008797, 116.35963000032427], [39.94639000019839, 116.36271999982819], [39.9469499999426, 116.36435000035226], [39.94711999968831, 116.36540999977171], [39.94729000033328, 116.36875999957442], [39.94733999994111, 116.36957999961737], [39.94733000037928, 116.37273999965134], [39.947370000425224, 116.37599999980023], [39.947370000425224, 116.37673000018947], [39.947370000425224, 116.37895999960438], [39.9474099995719, 116.38110999982666], [39.94740000001002, 116.38354000037077], [39.94744000005602, 116.38750000042478], [39.94744000005602, 116.3875799996174], [39.94748999966379, 116.39436000021385], [39.947529999709786, 116.397320000018], [39.947529999709786, 116.398180000107], [39.94762000026287, 116.40542999989464], [39.94762000026287, 116.40633000002958], [39.947660000308815, 116.40737000032527], [39.94779999957035, 116.41029000008348], [39.947930000169436, 116.41359999984013], [39.947930000169436, 116.41449999997508], [39.94797000021538, 116.41540000011003], [39.94801000026138, 116.41685999998901], [39.948200000030056, 116.42176000022391], [39.948240000076, 116.42330999975673], [39.948240000076, 116.4237300002394], [39.948240000076, 116.4246900004432], [39.94815000042223, 116.42521000014142], [39.9480199998232, 116.42558999967878], [39.947680000331786, 116.42628000002208], [39.94737999998705, 116.42671000006646], [39.946820000242894, 116.42714000011097], [39.94647999985216, 116.42730999985667], [39.945960000153946, 116.42747999960238], [39.94395000009246, 116.42743999955644], [39.94356000009401, 116.42743999955644], [39.94286999975071, 116.42743999955644], [39.94206000016891, 116.42740000040976], [39.93660999975174, 116.42761000020141], [39.93592000030782, 116.42765000024735], [39.93471999982819, 116.4276900002933], [39.934329999829686, 116.4276900002933], [39.92905999961931, 116.427860000039], [39.928629999574866, 116.427860000039], [39.92802999978471, 116.42790999964677], [39.9274700000405, 116.42794999969283], [39.92519000011845, 116.42804999980774], [39.92094999974273, 116.42831000010653], [39.919699999655336, 116.42835000015248], [39.918890000073475, 116.42839000019842], [39.91636000031383, 116.42851999989819], [39.915810000131444, 116.42851999989819], [39.91525000038729, 116.42855999994413], [39.91228000012194, 116.42878000019687], [39.91193999973126, 116.42886000028886], [39.91035000015245, 116.42915999973422], [39.909539999671324, 116.42937999998708], [39.90828999958387, 116.42946999964079], [39.906100000214906, 116.42954999973279], [39.90585000037726, 116.42954999973279], [39.90485999968928, 116.42962999982467], [39.904259999899125, 116.42968000033181], [39.90409000015342, 116.42972000037776], [39.90399999960033, 116.42972000037776], [39.903359999764234, 116.42979999957038], [39.902160000183926, 116.43005999986917], [39.90163999958634, 116.43015000042226], [39.90121000044121, 116.43011000037632], [39.900569999705795, 116.43001999982323], [39.90023000021438, 116.42997999977717], [39.899920000307816, 116.42997999977717], [39.8994599997792, 116.43011000037632], [39.899020000172925, 116.43036999977573], [39.898810000381275, 116.43061999961333], [39.89859000012848, 116.430960000004], [39.89846999999054, 116.43135000000257], [39.89834000029083, 116.43169999995507], [39.89785999973924, 116.43375999962439], [39.897320000018055, 116.43617999970729], [39.89719000031829, 116.43664999979774], [39.896970000065494, 116.43699000018842], [39.896760000273844, 116.43728999963389], [39.896419999883165, 116.43754999993257], [39.895940000230894, 116.43775999972422], [39.893799999570376, 116.43781000023137], [39.8935400001709, 116.43781000023137], [39.89337000042525, 116.43781000023137], [39.89233999969127, 116.43789000032336], [39.891389999948615, 116.43797999997707], [39.89079000015846, 116.43806000006896], [39.890320000068016, 116.43810999967684], [39.88611999973824, 116.43867000032037], [39.88525999964929, 116.43878999955894], [39.88473999995108, 116.43888000011202], [39.8843999995604, 116.43892000015796], [39.88319999998009, 116.43904999985762], [39.882339999891144, 116.43917999955738], [39.88190999984664, 116.43921999960332], [39.88143999975625, 116.43931000015641], [39.88088000001204, 116.43939999981023], [39.879640000385734, 116.43962000006297], [39.87813999956137, 116.43992000040771], [39.87737000002551, 116.43995999955439], [39.87689999993512, 116.43988000036177], [39.876300000144965, 116.43966999967085], [39.87564999984767, 116.4392799996723], [39.8745300003593, 116.43878999955894], [39.87320000017991, 116.43832000036775], [39.871740000300804, 116.43797999997707], [39.87131000025636, 116.43789000032336], [39.870709999566884, 116.43773000013948], [39.87002000012296, 116.43728999963389], [39.86959999964034, 116.43668999984368], [39.86942000033281, 116.4363900003982], [39.86924999968778, 116.43582999975479], [39.86916999959584, 116.43522999996458], [39.86920999964184, 116.43385000017747], [39.869409999871664, 116.43096999956583], [39.86950000042475, 116.42937999998708], [39.86959000007852, 116.42710000006502], [39.869830000354284, 116.42223999987618], [39.87000000009999, 116.41954000037083], [39.87000000009999, 116.41841999998303], [39.86994999959285, 116.41686999955095], [39.869910000446225, 116.41614000006098], [39.869910000446225, 116.4157999996703], [39.86985999993908, 116.41507000018044], [39.86985999993908, 116.41497999962735], [39.86981999989314, 116.41472000022793], [39.86981999989314, 116.41451000043628], [39.86981999989314, 116.41412000043772], [39.86977999984714, 116.41365000034727], [39.86973000023937, 116.41265999965935], [39.86969000019343, 116.41222999961485], [39.86977999984714, 116.41150000012499], [39.870040000145934, 116.4107299996898], [39.87033999959135, 116.41004999980771], [39.87051000023638, 116.4096999998552], [39.87072000002803, 116.40906000001905], [39.870809999681796, 116.40846000022884], [39.87084999972774, 116.40776999988566], [39.87076000007397, 116.40450000017495], [39.87067000042026, 116.4002500002374], [39.87063000037426, 116.39926000044875], [39.870499999775234, 116.39651999999808], [39.87041000012147, 116.39561999986313], [39.87037000007547, 116.39522999986468], [39.87024000037576, 116.39120000017988], [39.87016999984564, 116.38917999965736], [39.87008000019193, 116.38703000033433], [39.86998999963885, 116.38545000031729], [39.86994999959285, 116.38428999988366], [39.869910000446225, 116.38307999984215], [39.86969000019343, 116.37962000036282], [39.86965000014743, 116.37919000031832], [39.86961000010149, 116.37864000013599], [39.86938999984869, 116.37542000003305], [39.86914999957287, 116.3720199997233], [39.8690999999651, 116.3714300003943], [39.86901999987316, 116.37004999970782], [39.868970000265335, 116.36953999957143], [39.86893000021939, 116.36877000003551], [39.8687099999666, 116.3658500002773], [39.868629999874656, 116.36464999979773], [39.86856000024386, 116.36388000026182], [39.868469999690774, 116.36277000033533], [39.868299999945066, 116.361360000064], [39.868210000291356, 116.36066999972081], [39.86782000029285, 116.35809000035329], [39.86723999962635, 116.35423999997613], [39.867060000318816, 116.35265999995909], [39.866980000226874, 116.35081999964336], [39.86706999988064, 116.34806999963087]], [[39.86922999966481, 116.34245999992913], [39.86887999971225, 116.34245999992913]], [[39.86922999966481, 116.34245999992913], [39.86893000021939, 116.34254000002102], [39.86815999978421, 116.34297999962735], [39.867640000086, 116.34354000027088], [39.86733999974126, 116.34405000040726], [39.86716000043373, 116.34459999969033], [39.8670299998347, 116.34520999994163], [39.8670299998347, 116.34580999973173], [39.86694000018093, 116.34806999963087], [39.866849999627846, 116.35089999973525], [39.866849999627846, 116.35198000007699], [39.86688999967379, 116.35265999995909], [39.867060000318816, 116.35428000002207], [39.86756999955588, 116.35725000028731], [39.86807999969227, 116.36070999976675], [39.86817000024536, 116.36140000010994], [39.868299999945066, 116.3628199999431], [39.86842999964483, 116.36388000026182], [39.86846000012895, 116.36468999984368], [39.868549999782715, 116.3658500002773], [39.868799999620364, 116.36877000003551], [39.86883999966631, 116.36959000007846], [39.868890000173394, 116.37004999970782], [39.868970000265335, 116.3714300003943], [39.86901999987316, 116.3720199997233], [39.869220000102985, 116.37542000003305], [39.86948000040172, 116.37864000013599], [39.86952000044772, 116.37923000036426], [39.86952000044772, 116.37962000036282], [39.86973000023937, 116.38326000004906], [39.86985999993908, 116.38545000031729], [39.86994999959285, 116.38703000033433], [39.870040000145934, 116.38917999965736], [39.87010999977673, 116.39114999967285], [39.87028000042176, 116.39522999986468], [39.87028000042176, 116.39561999986313], [39.87037000007547, 116.39656000004402], [39.870499999775234, 116.39926000044875], [39.870499999775234, 116.4002500002374], [39.870599999890146, 116.40376999978571], [39.87072000002803, 116.40776999988566], [39.87067999998209, 116.4085000002749], [39.870599999890146, 116.40901999997311], [39.87037999963735, 116.40957000015544], [39.870120000237876, 116.4101299998996], [39.86973000023937, 116.41107999964231], [39.86961000010149, 116.4115899997787], [39.86957000005549, 116.41248999991365], [39.86961000010149, 116.41322000030289], [39.86965000014743, 116.41369000039322], [39.86965000014743, 116.41412000043772], [39.86969000019343, 116.41454999958285], [39.86969000019343, 116.41472000022793], [39.86973000023937, 116.41497999962735], [39.86973000023937, 116.41507000018044], [39.86977999984714, 116.41575000006253], [39.86977999984714, 116.41614000006098], [39.86981999989314, 116.41686999955095], [39.869870000400226, 116.41841999998303], [39.869699999755255, 116.42223999987618], [39.86946000037875, 116.42710000006502], [39.86932999977972, 116.42933999994113], [39.869240000125956, 116.43093000041927], [39.86903999989613, 116.43424000017592], [39.86903999989613, 116.43535999966434], [39.86907999994207, 116.4356699995709], [39.86911999998807, 116.43600000039976], [39.86934000024087, 116.43652000009797], [39.86975999982417, 116.43721000044127], [39.86994000003102, 116.43742000023292], [39.87024000037576, 116.43767999963234], [39.87067000042026, 116.43789000032336], [39.871270000210416, 116.43806000006896], [39.87170000025486, 116.43814999972278], [39.87320000017991, 116.43849999967529], [39.874189999968564, 116.43884000006597], [39.8756000002399, 116.43945000031738], [39.876509999936616, 116.43992000040771], [39.87693999998106, 116.44009000015342], [39.87749999972527, 116.44013000019936], [39.87813999956137, 116.44009000015342], [39.87964999994762, 116.43980000026988], [39.88088000001204, 116.43953999997109], [39.88143999975625, 116.43943999985618], [39.88190999984664, 116.43939999981023], [39.882379999937086, 116.43931000015641], [39.88319999998009, 116.43921999960332], [39.8843999995604, 116.43904999985762], [39.884789999558905, 116.43900999981167], [39.88525999964929, 116.43892000015796], [39.88611999973824, 116.43888000011202], [39.890239999976075, 116.43832000036775], [39.89104999955788, 116.43824000027587], [39.891389999948615, 116.43818999976872], [39.89233999969127, 116.43810999967684], [39.89329000033331, 116.43802000002302], [39.8935400001709, 116.43802000002302], [39.893799999570376, 116.43802000002302], [39.895940000230894, 116.43793999993113], [39.89645999992911, 116.43775999972422], [39.896840000365785, 116.43750999988663], [39.8970999997652, 116.43715999993412], [39.897360000064, 116.43668999984368], [39.89748999976371, 116.43621999975323], [39.89803999994609, 116.43381000013142], [39.89830000024489, 116.43256000004408], [39.89859000012848, 116.43143999965628], [39.898810000381275, 116.43100999961189], [39.89924000042572, 116.43052999995962], [39.899709999616846, 116.43024000007597], [39.90009999961535, 116.43018999956894], [39.90099999975024, 116.43028000012202], [39.90177000018542, 116.43028000012202], [39.90314000041076, 116.43001999982323], [39.90399999960033, 116.42989000012346], [39.90409000015342, 116.42985000007752], [39.904259999899125, 116.42979999957038], [39.90485999968928, 116.4297600004237], [39.90585000037726, 116.42972000037776], [39.906100000214906, 116.42968000033181], [39.90828999958387, 116.42958999977873], [39.909499999625325, 116.42950999968684], [39.910399999760216, 116.42933999994113], [39.91185999963932, 116.42898999998852], [39.912329999729764, 116.4289000003348], [39.91525000038729, 116.42872999968984], [39.915810000131444, 116.42868999964378], [39.91636000031383, 116.42868999964378], [39.9188999996353, 116.42855999994413], [39.919699999655336, 116.42851999989819], [39.92094999974273, 116.42843000024436], [39.92519000011845, 116.42825999959939], [39.92734000034079, 116.4281200003378], [39.927980000176944, 116.4281200003378], [39.928629999574866, 116.42808000029186], [39.92905999961931, 116.42808000029186], [39.934329999829686, 116.427860000039], [39.93471999982819, 116.427860000039], [39.93596000035376, 116.42777999994712], [39.93660999975174, 116.42777999994712], [39.941670000170404, 116.42755999969427], [39.94286999975071, 116.42755999969427], [39.94360000013995, 116.42761000020141], [39.94395000009246, 116.42761000020141], [39.94604999980771, 116.42761000020141], [39.946909999896604, 116.42726999981073], [39.94746000007899, 116.42679000015846], [39.94776999998555, 116.42640999972173], [39.94811000037629, 116.42566999977078], [39.948240000076, 116.42521000014142], [39.94836999977571, 116.42435000005253], [39.94836999977571, 116.4237300002394], [39.94836999977571, 116.42326999971078], [39.94828000012194, 116.42176000022391], [39.948099999915144, 116.41540000011003], [39.948059999869145, 116.41449999997508], [39.94801000026138, 116.41373000043927], [39.94797000021538, 116.41205000030732], [39.94789000012344, 116.41025000003754], [39.947790000008524, 116.40633000002958], [39.94774999996258, 116.40542999989464], [39.94770000035476, 116.40413999976124], [39.947660000308815, 116.398180000107], [39.947660000308815, 116.397320000018], [39.94762000026287, 116.39436000021385], [39.94762000026287, 116.39329000033331], [39.94756999975573, 116.3875799996174], [39.94756999975573, 116.38750000042478], [39.947529999709786, 116.38354000037077], [39.94754000017093, 116.38110999982666], [39.94750000012493, 116.37895999960438], [39.94750000012493, 116.37673000018947], [39.94750000012493, 116.37599999980023], [39.947449999617845, 116.37496999996563], [39.947449999617845, 116.37273999965134], [39.94746000007899, 116.36965999970926], [39.94746000007899, 116.36875999957442], [39.94725000028734, 116.36540999977171], [39.94703999959637, 116.36423000021443], [39.94674000015095, 116.36322999996457], [39.94651999989816, 116.36267999978224], [39.94524000022591, 116.35959000027833], [39.94506999958088, 116.35916000023394], [39.944600000389755, 116.35762000026284], [39.94399999970028, 116.35547999960238], [39.94370999981669, 116.3544000001599], [39.943279999772244, 116.35278000009703], [39.943069999980594, 116.35192000000802], [39.942550000282324, 116.35015999978418], [39.942289999983586, 116.34970000015494], [39.94212000023788, 116.34951999994814], [39.94165000014743, 116.34917999955735], [39.941349999802696, 116.34908999990364], [39.94075000001254, 116.34908999990364], [39.94023000031433, 116.34917999955735], [39.93658999972877, 116.34931000015649], [39.93619999973026, 116.34935000020243], [39.93529999959537, 116.34939000024838], [39.934100000015064, 116.34939000024838], [39.93301999967332, 116.34947999990209], [39.927920000107974, 116.3497299997398], [39.92679999972029, 116.34978000024682], [39.92619999993008, 116.3498299998547], [39.92500000034977, 116.34986000033882], [39.92332000021787, 116.34990999994659], [39.921259999649294, 116.34999000003859], [39.920060000068986, 116.3500799996923], [39.91958999997854, 116.3500799996923], [39.91872999988965, 116.35011999973824], [39.9170200001729, 116.35015999978418], [39.915259999949114, 116.35021000029133], [39.91096000040375, 116.35042000008298], [39.910109999876624, 116.35042000008298], [39.909160000133966, 116.35029000038332], [39.90799999970028, 116.35021000029133], [39.906840000165914, 116.35021000029133], [39.90456999980569, 116.35029000038332], [39.902940000180934, 116.35033999999109], [39.90238000043672, 116.35038000003703], [39.90144000025583, 116.35038000003703], [39.90054000012094, 116.35042000008298], [39.899419999733254, 116.35046999969074], [39.89873000028933, 116.35042000008298], [39.898220000152946, 116.35021999985315], [39.89762000036279, 116.34974000020088], [39.89736999962582, 116.34931999971832], [39.897070000180406, 116.34841999958337], [39.8969000004347, 116.34547000024043], [39.8969000004347, 116.3449099995969], [39.89676999983567, 116.34422000015297], [39.89660000008996, 116.34366999997053], [39.89631000020637, 116.34309999976529], [39.895960000253865, 116.34276000027387], [39.89545000011748, 116.34245999992913], [39.89510999972674, 116.34237999983714], [39.892960000403775, 116.34237999983714], [39.89206000026883, 116.34241000032137], [39.891200000179936, 116.34241000032137], [39.89038000013693, 116.34241000032137], [39.8898299999546, 116.34245999992913], [39.88935000030233, 116.34245999992913], [39.88681999964331, 116.34251000043628], [39.88592000040774, 116.34251000043628], [39.885660000109, 116.34251000043628], [39.885149999972555, 116.34251000043628], [39.87991999980818, 116.34262999967484], [39.87505999961934, 116.34301999967329], [39.87416000038377, 116.34305999971923], [39.87295999990414, 116.34293000001958], [39.87150000002504, 116.34272000022793], [39.87055999984415, 116.34258999962879], [39.86922999966481, 116.34245999992913]]],\n",
       "                {&quot;bubblingMouseEvents&quot;: true, &quot;color&quot;: &quot;red&quot;, &quot;dashArray&quot;: null, &quot;dashOffset&quot;: null, &quot;fill&quot;: false, &quot;fillColor&quot;: &quot;red&quot;, &quot;fillOpacity&quot;: 0.2, &quot;fillRule&quot;: &quot;evenodd&quot;, &quot;lineCap&quot;: &quot;round&quot;, &quot;lineJoin&quot;: &quot;round&quot;, &quot;noClip&quot;: false, &quot;opacity&quot;: 1.0, &quot;smoothFactor&quot;: 1.0, &quot;stroke&quot;: true, &quot;weight&quot;: 3}\n",
       "            ).addTo(map_4556fb80700f6396b38423d4ff6ea980);\n",
       "        \n",
       "    \n",
       "            var marker_e517c31c29f903c6b06cf309ab532dbb = L.marker(\n",
       "                [39.870232415159535, 116.39098111411266],\n",
       "                {}\n",
       "            ).addTo(map_4556fb80700f6396b38423d4ff6ea980);\n",
       "        \n",
       "    \n",
       "            var icon_ce5b88834236253cfd04cd9a438a6867 = L.AwesomeMarkers.icon(\n",
       "                {&quot;extraClasses&quot;: &quot;fa-rotate-0&quot;, &quot;icon&quot;: &quot;info-sign&quot;, &quot;iconColor&quot;: &quot;white&quot;, &quot;markerColor&quot;: &quot;red&quot;, &quot;prefix&quot;: &quot;glyphicon&quot;}\n",
       "            );\n",
       "            marker_e517c31c29f903c6b06cf309ab532dbb.setIcon(icon_ce5b88834236253cfd04cd9a438a6867);\n",
       "        \n",
       "    \n",
       "            var marker_2cd4c6ff34c88887b0eeac4dfb40630c = L.marker(\n",
       "                [39.90486216559735, 116.38944233292027],\n",
       "                {}\n",
       "            ).addTo(map_4556fb80700f6396b38423d4ff6ea980);\n",
       "        \n",
       "    \n",
       "            var icon_42a72f66f8785a847a40cc3b705e6a4e = L.AwesomeMarkers.icon(\n",
       "                {&quot;extraClasses&quot;: &quot;fa-rotate-0&quot;, &quot;icon&quot;: &quot;info-sign&quot;, &quot;iconColor&quot;: &quot;white&quot;, &quot;markerColor&quot;: &quot;black&quot;, &quot;prefix&quot;: &quot;glyphicon&quot;}\n",
       "            );\n",
       "            marker_2cd4c6ff34c88887b0eeac4dfb40630c.setIcon(icon_42a72f66f8785a847a40cc3b705e6a4e);\n",
       "        \n",
       "    \n",
       "            var marker_2f292d656cdb8bf09c6c73e16a7e55e8 = L.marker(\n",
       "                [39.870232415159535, 116.39098111411266],\n",
       "                {}\n",
       "            ).addTo(map_4556fb80700f6396b38423d4ff6ea980);\n",
       "        \n",
       "    \n",
       "            var icon_e78d9c534743f106f517b5d51c1e527c = L.AwesomeMarkers.icon(\n",
       "                {&quot;extraClasses&quot;: &quot;fa-rotate-0&quot;, &quot;icon&quot;: &quot;info-sign&quot;, &quot;iconColor&quot;: &quot;white&quot;, &quot;markerColor&quot;: &quot;pink&quot;, &quot;prefix&quot;: &quot;glyphicon&quot;}\n",
       "            );\n",
       "            marker_2f292d656cdb8bf09c6c73e16a7e55e8.setIcon(icon_e78d9c534743f106f517b5d51c1e527c);\n",
       "        \n",
       "    \n",
       "            var marker_5b1e45636c4247d332533beed738330a = L.marker(\n",
       "                [39.86661000025134, 116.34061999961341],\n",
       "                {}\n",
       "            ).addTo(map_4556fb80700f6396b38423d4ff6ea980);\n",
       "        \n",
       "    \n",
       "            var icon_780b9f7db4c6138b7c2d61950d1aeae8 = L.AwesomeMarkers.icon(\n",
       "                {&quot;extraClasses&quot;: &quot;fa-rotate-0&quot;, &quot;icon&quot;: &quot;info-sign&quot;, &quot;iconColor&quot;: &quot;white&quot;, &quot;markerColor&quot;: &quot;orange&quot;, &quot;prefix&quot;: &quot;glyphicon&quot;}\n",
       "            );\n",
       "            marker_5b1e45636c4247d332533beed738330a.setIcon(icon_780b9f7db4c6138b7c2d61950d1aeae8);\n",
       "        \n",
       "    \n",
       "            var marker_14d05d4adbd4df27355a283f2448cae6 = L.marker(\n",
       "                [39.86922999966481, 116.34245999992913],\n",
       "                {}\n",
       "            ).addTo(map_4556fb80700f6396b38423d4ff6ea980);\n",
       "        \n",
       "    \n",
       "            var icon_fe2e02c30a77347452350d4a7d4512f6 = L.AwesomeMarkers.icon(\n",
       "                {&quot;extraClasses&quot;: &quot;fa-rotate-0&quot;, &quot;icon&quot;: &quot;info-sign&quot;, &quot;iconColor&quot;: &quot;white&quot;, &quot;markerColor&quot;: &quot;green&quot;, &quot;prefix&quot;: &quot;glyphicon&quot;}\n",
       "            );\n",
       "            marker_14d05d4adbd4df27355a283f2448cae6.setIcon(icon_fe2e02c30a77347452350d4a7d4512f6);\n",
       "        \n",
       "&lt;/script&gt;\" style=\"position:absolute;width:100%;height:100%;left:0;top:0;border:none !important;\" allowfullscreen webkitallowfullscreen mozallowfullscreen></iframe></div></div>"
      ],
      "text/plain": [
       "<folium.folium.Map at 0x1dc142a85e0>"
      ]
     },
     "execution_count": 67,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "m = folium.Map([39.9, 116.39],\n",
    "               tiles=tile,attr='geoq',\n",
    "               zoom_start=12)\n",
    "aLineTofLine(road).add_to(m)\n",
    "\n",
    "folium.Marker(location=[road.centroid.Y,road.centroid.X],\n",
    "icon=folium.Icon(color='red')).add_to(m)\n",
    "folium.Marker(location=[road.trueCentroid.Y,road.trueCentroid.X],\n",
    "icon=folium.Icon(color='black')).add_to(m)\n",
    "folium.Marker(location=[road.labelPoint.Y,road.labelPoint.X],\n",
    "icon=folium.Icon(color='pink')).add_to(m)\n",
    "folium.Marker(location=[road.firstPoint.Y,road.firstPoint.X],\n",
    "icon=folium.Icon(color='orange')).add_to(m)\n",
    "folium.Marker(location=[road.lastPoint.Y,road.lastPoint.X],\n",
    "icon=folium.Icon(color='green')).add_to(m)\n",
    "m"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3.7.11 ('base')",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.11"
  },
  "orig_nbformat": 4,
  "vscode": {
   "interpreter": {
    "hash": "06b308fdbfd5979111721ebbf4de1ae2cbf405c7740d4ab5c57cb4c3e518bed6"
   }
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
